package com.zpark.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zpark.pojo.Equipment;
import com.zpark.service.EquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhangbing
 * @date
 * @description TODO
 */
@RestController //responsebody+controller
@Api("Swgger2 接口文档")
public class EquipmentController {

    @Autowired
    private EquipmentService equipmentService;


    @GetMapping("findAll")
    public List<Equipment> findAll(){
        return equipmentService.findAll();
    }

    //根据ID进行查询
    @GetMapping("/findById/{id}")
    @ApiImplicitParam(name="id",value ="用户id")
    public Equipment findById(@PathVariable int id){
        Equipment equipment = equipmentService.findById(id);
        return  equipment;
    }

    @PostMapping("/addEquipment")
    public String addEquipment(Equipment equipment){

        return "Hello Swagger2";
    }

    @PutMapping("/updateEquipment")
    public int updateEquipment(){

        return 1;
    }

    @DeleteMapping("/delById/{id}")

    public int delById(@PathVariable int id){
        return 1;
    }


}
